CruiseControl.NET : Filtered Source Control Block
This page last changed on Jun 09, 2005 by orogers.
What is FilteredSourceControl?The FilteredSourceControl allows you to filter out modifications that are used to trigger a build. If for example, you have certain files (such as web pages or document files) under source control that you don't want to have trigger the build, you can use this class to ensure that their changes will keep a new build from launching.The FilteredSourceControl works together with all of the source controls supported by CCNet (including the Multi Source Control Block). It can also be included under the Multi Source Control Block provider so that you could have multiple FilterSourceControls each filtering a different set of modifications from different source control providers. Essentially, it acts as a decorator (or an example of the pipes and filters pattern ), wrapping around the specific SourceControl provider that you want to use. The FilteredSourceControl includes both inclusion and exclusion filters for specifying what modifications should be included/excluded. Multiple inclusion and exclusion filters can be specified or, alternately, no inclusion or exclusion filter could be specified. If a modification is matched by both the inclusion and exclusion filter, then the exclusion filter will take preference and the modification will not be included in the modification set. At this point, CCNet only supports two types of filters: PathFilters and UserFilters. It is relatively straightforward to build new filters, (such as one to filter modifications based on email address).Configuration Examples<sourcecontrol type="filtered"> <sourceControlProvider type="vss" autoGetSource="true"> <project>$/Kunigunda/ServiceLocator</project> <workingDirectory>C:\CCNet\Kunigunda\ServiceLocator</workingDirectory> <username>urosn</username> <password></password> <ssdir>c:\localvss</ssdir> </sourceControlProvider> <inclusionFilters> <pathFilter> <pattern>$/Kunigunda/ServiceLocator/Sources/**/*.*</pattern> </pathFilter> </inclusionFilters> <exclusionFilters> <pathFilter> <pattern>$/Kunigunda/ServiceLocator/Sources/Kunigunda.ServiceLocator/AssemblyInfo.cs</pattern> </pathFilter> <pathFilter> <pattern>$/**/*.vssscc</pattern> </pathFilter> <userFilter> <names><name>Perry</name><name>Joe</name></names> </userFilter> </exclusionFilters> </sourcecontrol> This example filters out any modifications to the AssemblyInfo.cs file that have been checked in to Visual Source Safe Source Control Block. Configuration Elements:FilteredSourceControl root element This is the root configuration element for the FilteredSourceControl.
PathFilter element The PathFilter can be used to filter modifications on the basis of their file path.
UserFilter element The UserFilter can be used to filter modifications on the basis of the username that committed the changes.
Using the PathFilter:PathFilter supports following wildcards:
Potential enhancements:
Implemented and contributed by Uros Novak. UserFilter by Perry Ismangil |
Document generated by Confluence on Jun 26, 2005 17:22 |